package com.imooc.pojo.vo;

import lombok.Data;

import java.util.List;

/**
 * 二级分类的VO
 */
@Data
public class CategoryVO {
    //我们的分类id不太可能用到分库分表的操作,所以我们定义一个int就行
    private Integer id;
    private String name;
    private String type;
    private Integer fatherId;
    /**
     * 三级分类VO
     */
    private List<SubCategoryVO> subCatList;

    /**
     * ELECT f.id        AS id,
     *                f.`name`    AS `name`,
     *                f.type      AS type,
     *                f.father_id AS fatherId,
     *                c.id        AS subId,
     *                c.`name`    AS subName,
     *                c.type      AS subType,
     *                c.father_id AS subFatherId
     *         FROM category f
     *                  LEFT JOIN category c ON f.id = c.father_id
     *         WHERE f.father_id = #{rootCatId}
     */

}